import request from "@/utils/request"; 
//import {pa} from 'element-plus/es/locales.mjs'

//暴露12个函数，因为用户模块 12个接口
//以后若是接口地址改变，只需要改这个文档就行了

// 登录
// 登录
export const checkLogin = (data) => {
    return request.post('/users/checkLogin',data)
}

// 获取账号（个人中心）信息

export const accountInfo = (data) => {
    return request.get('/users/accountinfo',{params:data})
}

//获取账号列表
 export const accountList = (data) => {
    return request.get('/users/list',{params:data})
}

//删除账号
export const delAccount = (data) => {
    return request.get('/users/del',{params:data})
}

//添加账号
export const addAccount = (data) => {
    return request.post('/users/add',data)
}

//编辑账号
export const editAccount = (data) => {
    return request.post('/users/editpwd',data)
}

//头像上传
export const uploadAvatar = (data) => {
    return request.post('/users/avatar_upload',data)
}

//商品列表
export const goodsList = (data) => {
    return request.get('/goods/list',{params:data})
}

//删除商品
export const delGoods = (data) => {
    return request.get('/goods/del',{params:data})
}

//添加账号
export const addGoods = (data) => {
    return request.post('/goods/add',data)
}

//上传商品图片
export const uploadGoodsImg = (data) => {
    return request.post('/goods/goods_img_upload',data)
}

//分类

//添加分类
export const addCategory = (data) => {
    return request.post('/goods/addcate',data)
}

//获取分类
export const getCategory = (data) => {
    return request.get('/goods/catelist',{params:data})
}

//删除分类
export const delCategory = (data) => {
    return request.get('/goods/delcate',{params:data})
}

//修改分类
export const editCategory = (data) => {
    return request.post('/goods/editcate',data)
}

//获取店铺详情
export const shopInfo = (data) => {
    return request.get('/shop/info',{params:data})
}

//修改店铺信息
export const editShopInfo = (data) => {
    return request.post('/shop/edit',data)
}

//获取订单列表
export const getOrderList= (data) => {
    return request.get('/order/list',{params:data})
}


//获取订单详情

export const getOrderDetail= (data) => {
    return request.get('/order/detail',{params:data})
}

//统计报表

//1.首页报表
export const totaldata= (data) => {
    return request.get('/order/totaldata',{params:data})
}
//2.订单报表
export const orderData= (data) => {
    return request.get('/order/ordertotal',{params:data})
}

//3.商品报表
export const goodsData= (data) => {
    return request.get('/stats/goods',{params:data})
}